import requestApi from "../untils/request";
let base_url = "http://localhost:3000/api"
    //用户名和密码登录                                                                                                                                                                                                 
export const UserLoginApi = (user_name, user_password) => {
        return requestApi(base_url + "/user/login", { user_name, user_password }, "post")
    }
    // 获取手机验证码
export const getPhoneCodeApi = (url, params, type) => {
        return requestApi(base_url + url, params, type)
    }
    // 手机号登录
export const phoneLoginApi = (params) => {
        return requestApi(base_url + '/user/phonelogin', params, 'post')
    }
    // 注册
export const userReqisterApi = (params) => {
    return requestApi(base_url + '/user/register', params, 'post')
}

// 获取首页数据
export const getIndexListApi = (params) => {
        return requestApi('api/goods/type_list', params)
    }
    // https://x.dscmall.cn/api/catalog/list
    // 分类左侧数据
export const getCategoryLeftApi = () => {
    return requestApi('api/catalog/list')
}

// 分类右侧数据

export const getCategoryRightApi = (cat_id) => {
    return requestApi('api/catalog/list/' + cat_id)
}

//分类内页数据
export const postCategoryListAPi = (params) => {
    return requestApi('api/catalog/goodslist', params, 'post')
}

// 品牌列表
export const postBrandListApi = (params) => {
    return requestApi("api/catalog/brandlist", params, "post")
}